﻿using System;

namespace TalentChopper
{
    class Program
    {
        static ProxyEngine _engine = new ProxyEngine();
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                var time = TimeSpan.Parse(args[0]);
                _engine.Hour = time.Hours;
                _engine.Minute = time.Minutes;
                _engine.Second = time.Seconds;
            }

            _engine.Log += message =>
            {
                var color = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine(message);
                Console.ForegroundColor = color;
            };

            Console.Title = "Talent Chopper by Ulysses";
            Console.WriteLine("Talent Chopper");
            Console.WriteLine("by Ulysses, wdwxy12345@gmail.com");
            Console.WriteLine();
            Console.WriteLine(Properties.Resources.About);
            Console.WriteLine();
            Console.WriteLine("Press Enter to Start...");
            Console.ReadLine();
            Console.WriteLine("Listening... (Press Enter to Stop)");

            _engine.Start();
            Console.ReadLine();
            Console.WriteLine("Have a nice day.");
            _engine.Stop();
        }
    }
}
